package org.ssm.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Service;
import org.ssm.dao.UserDao;
import org.ssm.pojo.User;
import org.ssm.service.IUserService;

import javax.sql.DataSource;
import java.util.List;
@Service
public class UserService  implements IUserService {
    @Autowired
    private UserDao userDao;


    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;

    }

    @Override
    public List<User> selelctAll() {
        return userDao.selelctAll();
    }

    @Override
    public User selectOne(Integer empno) {
        return userDao.selectOne(empno);
    }

    @Override
    public void  insertUser(int uid, String name, int age, String sex, String address, double sal) {
          userDao.insertUser(uid,name,age,sex,address,sal);
    }

    @Override
    public void deleteUser(Integer uid) {
       userDao.deleteUser(uid);
    }

    @Override
    public void updateUSer(int uid, String name, int age, String sex, String address, double sal) {
        userDao.updateUSer(uid, name, age, sex, address, sal);
    }

    @Override
    public List<User> selectByCondition(Integer uid, String name, String address) {
       return userDao.selectByCondition(uid,name, address);
    }


}
